package le.ralph.quwen.cn.java.view.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import java.util.List;

import le.ralph.quwen.cn.R;
import le.ralph.quwen.cn.java.model.bean.UserInfo;


public class RvAdapter extends RecyclerView.Adapter<RvAdapter.ViewHolder> {

    private Context context;
    private List<UserInfo> userInfoList;

    public RvAdapter(Context context, List<UserInfo> userInfoList) {
        this.context = context;
        this.userInfoList = userInfoList;
    }


    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View rootView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_view_pager, parent, false);
        return new ViewHolder(rootView);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return 20;
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        RelativeLayout rootView;
        TextView tvContent;
        ImageView ivThumb;
        ImageView ivFavor;
        TextView tvFavor;
        TextView tvComment;
        TextView tvShared;
        ImageView ivPlay;

        public ViewHolder(View itemView) {
            super(itemView);
            rootView = itemView.findViewById(R.id.root_view);
            tvContent = itemView.findViewById(R.id.tv_content);
            ivThumb = itemView.findViewById(R.id.iv_author_thumb);
            ivFavor = itemView.findViewById(R.id.iv_favor);
            tvFavor = itemView.findViewById(R.id.tv_favor);
            tvComment = itemView.findViewById(R.id.tv_comment);
            tvShared = itemView.findViewById(R.id.tv_shared);
            ivPlay = itemView.findViewById(R.id.iv_play);
        }
    }
}